import Vue from 'vue'
import VueRouter from 'vue-router'
// import Home from '../views/Home.vue'
import Sort from '../components/admin/Sort';
import Garbage from '../components/admin/Garbage';
import MyExams from "../components/user/MyExams";
import CreateExam from "../components/user/CreateExam";
import Index from "../components/Index";
import Login from "../components/user/Login";
import Register from "../components/user/Register";
import Game from "../components/Game";
import CheckUsers from "../components/admin/CheckUsers";
import UserInfo from "../components/user/UserInfo";
import Statics from "../components/admin/Statics";
import AllExams from "../components/admin/AllExams";

Vue.use(VueRouter)


const routes = [
  {
    path: '/game',
    name: '小游戏',
    component: Game
  },
  {
    path: '/register',
    name: '用户登录',
    component: Register
  },
  {
    path: '/login',
    name: '用户登录',
    component: Login
  },

  // {
  //   path: '',
  //   name: '用户',
  //   component: Index,
  //   children:[
  //     {
  //       path: '/login',
  //       name: '用户登录',
  //       component: Login
  //     },
  //
  //     {
  //       path: '/garbage',
  //       name: '垃圾信息',
  //       component: Garbage
  //     }
  //   ]
  // }
  {
    path: '/',
    name: '信息管理',
    component: Index,
    children:[
      {
        path: '/sort',
        name: '分类信息',
        component: Sort
      },
      {
        path: '/userInfo',
        name: '个人信息',
        component: UserInfo
      },
      {
        path: '/garbage',
        name: '垃圾信息',
        component: Garbage
      },
      {
        path: '/myExams',
        name: '垃圾信息',
        component: MyExams
      },
      {
        path: '/statics',
        name: '分类信息',
        component: Statics
      },
      {
        path: '/allExams',
        name: '分类信息',
        component: AllExams
      }

    ]
  }
  ,
  {
    path:"/navigation",
    name:"导航2",
    component:Index,
    children:[
      {
        path: '/checkUsers',
        name: '用户审核',
        component: CheckUsers
      },
      {
        path: '/createExam',
        name: '问卷调查',
        component: CreateExam
      }
    ]
  }
]




const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
